package cn.zyjblogs.sms.configuration;


import cn.zyjblogs.sms.provider.CompositeSmsGranter;
import cn.zyjblogs.sms.provider.SmsGranter;
import cn.zyjblogs.sms.provider.aliyun.AliSmsHandleGranter;
import cn.zyjblogs.sms.provider.baidu.BaiduBceSmsHandleGranter;
import cn.zyjblogs.sms.provider.tencent.TenSmsHandleGranter;
import cn.zyjblogs.sms.task.constant.ProviderType;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhuyijun
 */
@Configuration
public class SmsConfiguration {
    @Bean
    public SmsGranter smsGranter() {
        List<SmsGranter> list = new ArrayList<>();
        list.add(new AliSmsHandleGranter(ProviderType.ALI));
        list.add(new TenSmsHandleGranter(ProviderType.TENCENT));
        list.add(new BaiduBceSmsHandleGranter(ProviderType.BAIDU));
        return new CompositeSmsGranter(list);
    }
}
